Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fonctionnalités "attestation de service public" et "labellisation france services" #580

Merged
merged 17 commits into from
Mar 28, 2022

Conversation

tut-tuuut
Copy link
Member

@tut-tuuut tut-tuuut commented Mar 17, 2022

🌮 Objectif

  • Alléger la fonctionnalité "attestation de service public" qui avait une grosse complexité pour une valeur ajoutée minime.
  • Affiner la fonction "labellisation france services"

🔍 Implémentation

  • Suppression du champ fichier "attestation de service public".
  • Ajout d'un champ "numéro d'immatriculation france services", qui apparaît si la case "labellisation france services" est cochée.

🖼️ Images

Capture d’écran 2022-03-18 à 18 04 00
Capture d’écran 2022-03-18 à 18 03 55
Capture d’écran 2022-03-18 à 18 03 48
Capture d’écran 2022-03-18 à 18 03 42

@tut-tuuut tut-tuuut force-pushed the ahr/public-service-delegation branch from 3bd97a4 to c497efc Compare March 18, 2022 17:01
@tut-tuuut tut-tuuut marked this pull request as ready for review March 18, 2022 17:04
@tut-tuuut tut-tuuut changed the title Diminution de la fonctionnalité "attestation de service public" Fonctionnalités "attestation de service public" et "labellisation france services" Mar 18, 2022
@tut-tuuut tut-tuuut force-pushed the ahr/public-service-delegation branch from a6ead7c to 94e0c58 Compare March 24, 2022 16:41
@tut-tuuut
Copy link
Member Author

@christophehenry Ajouts récents : nettoyage du champ côté serveur + contraintes en base

required=False,
)

public_service_delegation_attestation = FileField(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

En attendant de savoir comment on réimplémente la fonctionnalité, j'ai carrément supprimé le champ.

@@ -125,6 +126,20 @@ def __init__(self, **kwargs):
"data-other-value": RequestOriginConstants.OTHER.value,
},
)
self.widget_attrs(
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Attributs ajoutés sur les checkbox pour la gestion du JS

public_service_delegation_attestation = ""

france_services_label = FuzzyChoice([True, False])
france_services_label = False
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

J'arrête les FuzzyChoice dans les factories, parce que ça fait des FuzzyTests après… Et déjà comme ça ce fut compliqué :D

@@ -21,26 +21,27 @@

@tag("functional")
class OrganisationRequestFormViewTests(FunctionalTestCase):
def test_form_normal_organisation(self):
def test_form_normal_organisation_with_fs_label(self):
issuer: Issuer = IssuerFactory()
request: OrganisationRequest = OrganisationRequestFactory.build(
type_id=RequestOriginConstants.MEDIATHEQUE.value,
public_service_delegation_attestation=False,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NPPT : virer cette ligne

@@ -308,7 +311,6 @@ def test_404_on_bad_issuer_id(self):
def test_new_organisation_request_is_displayed_with_links(self):
organisation = DraftOrganisationRequestFactory(issuer=self.issuer)
response = self.client.get(self.get_url(self.issuer.issuer_id))
print(response.content)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oups (c'était ma faute)

cleaned_data.pop("is_private_org")
cleaned_data.pop("france_services_label")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pour explication : sans ces lignes-là, c'est comme si j'avais is_private_org = True.

Une checkbox cochée dans un formulaire HTML, ça se détecte au fait que la clé est présente dans les données, quelle que soit la valeur associée.

Comment on lines 217 to 222
def get_readonly_fields(self, request, obj=None):
readonly_fields = list(self.readonly_fields)
if obj and obj.data_pass_id:
readonly_fields.append("data_pass_id")
return readonly_fields

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm je ne sais pas ce que ça fait là, ça.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Et hop, j'ai supprimé le commit, lalala

@tut-tuuut tut-tuuut force-pushed the ahr/public-service-delegation branch from 7153eb8 to 93aa9db Compare March 28, 2022 07:58
@tut-tuuut tut-tuuut force-pushed the ahr/public-service-delegation branch from 89fa649 to cabd264 Compare March 28, 2022 12:36
@tut-tuuut tut-tuuut merged commit 9c492b4 into main Mar 28, 2022
@tut-tuuut tut-tuuut deleted the ahr/public-service-delegation branch March 28, 2022 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants